import { createSlice, createAsyncThunk } from "@reduxjs/toolkit";
import axios from "axios";
const initialState={
    count:0,
    price:10.5,
    sum:0,
    channelList:[]
}
const fetchChannels=createAsyncThunk('counter/fetchChannels',async()=>{
    let res=await axios.get('http://blogapi.shbwyz.com/article/list')
    return res.data.rows
})
const counterSlice = createSlice({
  name: "counter",
  initialState,
  reducers: {
    
  },

});

export {fetchChannels}

export const { setChannerlList } = counterSlice.actions;

export default counterSlice.reducer;

